using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._GeodatabaseAdministration
{
    /// <summary>
    /// <para>Change Privileges</para>
    /// <para>Establishes or changes user access privileges to the input enterprise database datasets, stand-alone feature classes, or tables.</para>
    /// <para>建立或更改用户对输入企业级数据库数据集、独立要素类或表的访问权限。</para>
    /// </summary>    
    [DisplayName("Change Privileges")]
    public class ChangePrivileges : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ChangePrivileges()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_dataset">
        /// <para>Input Dataset</para>
        /// <para>The datasets, feature classes, or tables whose access privileges will be changed.</para>
        /// <para>将更改其访问权限的数据集、要素类或表。</para>
        /// </param>
        /// <param name="_user">
        /// <para>User</para>
        /// <para>The database user name whose privileges are being modified.</para>
        /// <para>正在修改其权限的数据库用户名。</para>
        /// </param>
        public ChangePrivileges(List<object> _in_dataset, object _user)
        {
            this._in_dataset = _in_dataset;
            this._user = _user;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Change Privileges";

        public override string CallName => "management.ChangePrivileges";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_in_dataset, _user, _View.GetGPValue(), _Edit.GetGPValue(), _out_dataset];

        /// <summary>
        /// <para>Input Dataset</para>
        /// <para>The datasets, feature classes, or tables whose access privileges will be changed.</para>
        /// <para>将更改其访问权限的数据集、要素类或表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Dataset")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _in_dataset { get; set; }


        /// <summary>
        /// <para>User</para>
        /// <para>The database user name whose privileges are being modified.</para>
        /// <para>正在修改其权限的数据库用户名。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("User")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _user { get; set; }


        /// <summary>
        /// <para>View (Select)</para>
        /// <para><xdoc>
        ///   <para>Establishes the user's view privileges.</para>
        ///   <bulletList>
        ///     <bullet_item>Do not change to view privileges—No change to the user's existing view privilege. If the user has view privileges, they will continue to have view privileges. If the user doesn't have view privileges, they will continue to not have view privileges.</bullet_item><para/>
        ///     <bullet_item>Grant view privileges—Allows user to view datasets.</bullet_item><para/>
        ///     <bullet_item>Revoke view privileges—Removes all user privileges to view datasets.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>建立用户的查看权限。</para>
        ///   <bulletList>
        ///     <bullet_item>不更改查看权限 - 不更改用户的现有查看权限。如果用户具有查看权限，则他们将继续具有查看权限。如果用户没有查看权限，他们将继续没有查看权限。</bullet_item><para/>
        ///     <bullet_item>授予查看权限 - 允许用户查看数据集。</bullet_item><para/>
        ///     <bullet_item>撤消查看权限 - 移除查看数据集的所有用户权限。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("View (Select)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _View_value? _View { get; set; } = null;

        public enum _View_value
        {
            /// <summary>
            /// <para>Do not change to view privileges</para>
            /// <para>Do not change to view privileges—No change to the user's existing view privilege. If the user has view privileges, they will continue to have view privileges. If the user doesn't have view privileges, they will continue to not have view privileges.</para>
            /// <para>不更改查看权限 - 不更改用户的现有查看权限。如果用户具有查看权限，则他们将继续具有查看权限。如果用户没有查看权限，他们将继续没有查看权限。</para>
            /// </summary>
            [Description("Do not change to view privileges")]
            [GPEnumValue("AS_IS")]
            _AS_IS,

            /// <summary>
            /// <para>Grant view privileges</para>
            /// <para>Grant view privileges—Allows user to view datasets.</para>
            /// <para>授予查看权限 - 允许用户查看数据集。</para>
            /// </summary>
            [Description("Grant view privileges")]
            [GPEnumValue("GRANT")]
            _GRANT,

            /// <summary>
            /// <para>Revoke view privileges</para>
            /// <para>Revoke view privileges—Removes all user privileges to view datasets.</para>
            /// <para>撤消查看权限 - 移除查看数据集的所有用户权限。</para>
            /// </summary>
            [Description("Revoke view privileges")]
            [GPEnumValue("REVOKE")]
            _REVOKE,

        }

        /// <summary>
        /// <para>Edit (Update/Insert/Delete)</para>
        /// <para><xdoc>
        ///   <para>Establishes the user's edit privileges.</para>
        ///   <bulletList>
        ///     <bullet_item>Do not change edit privileges— No change to the user's existing edit privilege. If the user has edit privileges, they will continue to have edit privileges. If the user doesn't have edit privileges, they will continue to not have edit privileges. This is the default.</bullet_item><para/>
        ///     <bullet_item>Grant edit privileges—Allows the user to edit the input datasets.</bullet_item><para/>
        ///     <bullet_item>Revoke edit privileges—Removes the user's edit privileges. The user may still view the input dataset.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>建立用户的编辑权限。</para>
        ///   <bulletList>
        ///     <bullet_item>不更改编辑权限 - 不更改用户的现有编辑权限。如果用户具有编辑权限，则他们将继续拥有编辑权限。如果用户没有编辑权限，他们将继续没有编辑权限。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>授予编辑权限 - 允许用户编辑输入数据集。</bullet_item><para/>
        ///     <bullet_item>撤消编辑权限 - 撤消用户的编辑权限。用户仍可查看输入数据集。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Edit (Update/Insert/Delete)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _Edit_value? _Edit { get; set; } = null;

        public enum _Edit_value
        {
            /// <summary>
            /// <para>Do not change edit privileges</para>
            /// <para>Do not change edit privileges— No change to the user's existing edit privilege. If the user has edit privileges, they will continue to have edit privileges. If the user doesn't have edit privileges, they will continue to not have edit privileges. This is the default.</para>
            /// <para>不更改编辑权限 - 不更改用户的现有编辑权限。如果用户具有编辑权限，则他们将继续拥有编辑权限。如果用户没有编辑权限，他们将继续没有编辑权限。这是默认设置。</para>
            /// </summary>
            [Description("Do not change edit privileges")]
            [GPEnumValue("AS_IS")]
            _AS_IS,

            /// <summary>
            /// <para>Grant edit privileges</para>
            /// <para>Grant edit privileges—Allows the user to edit the input datasets.</para>
            /// <para>授予编辑权限 - 允许用户编辑输入数据集。</para>
            /// </summary>
            [Description("Grant edit privileges")]
            [GPEnumValue("GRANT")]
            _GRANT,

            /// <summary>
            /// <para>Revoke edit privileges</para>
            /// <para>Revoke edit privileges—Removes the user's edit privileges. The user may still view the input dataset.</para>
            /// <para>撤消编辑权限 - 撤消用户的编辑权限。用户仍可查看输入数据集。</para>
            /// </summary>
            [Description("Revoke edit privileges")]
            [GPEnumValue("REVOKE")]
            _REVOKE,

        }

        /// <summary>
        /// <para>Updated Dataset</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Dataset")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_dataset { get; set; }


        public ChangePrivileges SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}